/*INSERTION_TRADOIL*/
/******************************************************************************/
/*                                                                            */
/* !Layer           : STD                                                     */
/*                                                                            */
/* !Component       : MEMMAP                                                  */
/* !Description     : MEMMAP Configuration                                    */
/*                                                                            */
/* !File            : MEMMAP_H.TPL                                            */
/*                                                                            */
/* !Scope           : Public                                                  */
/*                                                                            */
/* !Target          : Genecode Tool v2.0.0.0                                  */
/*                                                                            */
/* !Vendor          : Valeo                                                   */
/*                                                                            */
/* COPYRIGHT 2009 VALEO                                                       */
/* all rights reserved                                                        */
/*                                                                            */
/******************************************************************************/
/* PVCS Information                                                           */
/* $Archive::   I:/PROJETS/LIBEMB/LOG/DIVERS/MEMMAP/LOG/MEMMAP_H.TPv         $*/
/* $Revision::   1.6      $$Author::   lvoilmy        $$Date::   10 Oct 2012 $*/
/******************************************************************************/
'/******************************************************************************/
/*                                                                            */
/* !Layer           : NONE                                                    */
/*                                                                            */
/* !Component       : MEMMAP                                                  */
/* !Description     : Mapping Section Configuration                           */
/*                                                                            */
/* !Module          : MEMMAP                                                  */
/* !Description     : Mapping Section Configuration                           */
/*                                                                            */
/* !File            : MEMMAP.H                                                */
/*                                                                            */
/* !Scope           : Public                                                  */
/*                                                                            */
/* !Target          :                                                         */
/*                                                                            */
/* !Vendor          : Valeo                                                   */
/*                                                                            */
/* Coding language  : C                                                       */
/*                                                                            */
/* COPYRIGHT 2009 VALEO                                                       */
/* all rights reserved                                                        */
/*                                                                            */
/******************************************************************************/
/* PVCS Information                                                           */
/* $Arc`'hive::                                                                $*/
/* $Rev`'ision::            $$Au`'thor::                  $$Da`'te::               $*/
/******************************************************************************/
/* `Date()': generated by Genecode  `Version()'                        */
/* From Source Template : MEMMAP_H.TPL                                        */
/******************************************************************************/

`
/******************************************************************************/
/*          SPEED_AND_UNSAFE  Mode Code Generation                            */
/******************************************************************************/
.MEMMAP_CFG WHERE (OPTIMIZATION = SPEED_AND_UNSAFE)
{
'
/******************************************************************************/
/*          MEMMAP selected mode:  SPEED_AND_UNSAFE                           */
/******************************************************************************/

/* The following if is used only due to automatic generation */
#if FALSE

/* Project section mappings */
`
.MEMMAP_MSN AS msn ORDERBY(INDEX)
{
"/* !Comment: " msn " Section allocation */
"
   SECTION AS memmap
   {
      msn.REALLOC AS realloc WHERE ((realloc.SECTION == memmap) and ( realloc.TO_SECTION.CODE_TO_INCLUDE == "TRUE") )
      {
            "#elif defined   " msn "_START_" msn.PREFIX  memmap"
   #undef          " msn "_START_" msn.PREFIX  memmap"
   "  TO_SECTION.START"
"
            "#elif defined   " msn "_STOP_"  msn.PREFIX  memmap"
   #undef          " msn "_STOP_"  msn.PREFIX  memmap"
   "  TO_SECTION.STOP"
"
      }
      WHERE ((msn.REALLOC AS realloc WHERE (realloc.SECTION == memmap) COUNT == 0) and ( memmap.CODE_TO_INCLUDE == "TRUE") )
      {
            "#elif defined   " msn "_START_" msn.PREFIX  memmap "
   #undef          " msn "_START_" msn.PREFIX  memmap"
   "  memmap.START"
"
            "#elif defined   " msn "_STOP_"  msn.PREFIX  memmap "
   #undef          " msn "_STOP_" msn.PREFIX  memmap"
   "  memmap.STOP "
"
      }
   }
}

.MEMMAP_PARENT AS parent WHERE(CODE_TO_INCLUDE == "TRUE") ORDERBY(INDEX)
{
"/* !Comment: " parent " Parent section allocation */
"
"#elif defined   START_" parent "
   #undef          START_" parent "
   " START"
"
"#elif defined   STOP_"  parent "
   #undef          STOP_"  parent "
   " STOP"
"
}


'
#endif
`
}
'

`
/******************************************************************************/
/*          SAFE  Mode Code Generation                                        */
/******************************************************************************/
.MEMMAP_CFG WHERE (OPTIMIZATION = SAFE)
{
'
/******************************************************************************/
/*          MEMMAP selected mode:  SAFE                                       */
/******************************************************************************/
#define MEMMAP_ERROR

/* The following if is used only due to automatic generation */
#if !defined MEMMAP_ERROR

/* Project section mappings */
`
.MEMMAP_MSN AS msn ORDERBY(INDEX)
{
"/* !Comment: " msn " Section allocation */
"
   SECTION AS memmap
   {
      msn.REALLOC AS realloc WHERE (realloc.SECTION == memmap)
      {
            "#elif defined   " msn "_START_" msn.PREFIX memmap
         "
"        "   #undef  " msn "_START_" msn.PREFIX memmap "
"        "   #define START_" TO_SECTION "
"        "#elif defined   " msn "_STOP_" msn.PREFIX   memmap "
"        "   #undef  " msn "_STOP_" msn.PREFIX memmap "
"        "   #define STOP_" TO_SECTION "
"
      }
      WHERE (msn.REALLOC AS realloc WHERE (realloc.SECTION == memmap) COUNT == 0)
      {
            "#elif defined   " msn "_START_" msn.PREFIX   memmap
         "
"        "   #undef  " msn "_START_" msn.PREFIX memmap "
"        "   #define START_" memmap "
"        "#elif defined   " msn "_STOP_" msn.PREFIX   memmap "
"        "   #undef  " msn "_STOP_" msn.PREFIX memmap "
"        "   #define STOP_" memmap "
"
      }
   }
}


'
#endif

/* ECU specific section mappings */
#ifndef MEMMAP_START_DONE

`
.MEMMAP_PARENT AS memmap ORDERBY(INDEX)
{
"/* !Comment: " memmap " Start Section treatment */
"
   WHERE(INDEX == 0)
   {
      "   #if defined   START_"   memmap
   }
   WHERE(INDEX != 0)
   {
      "   #elif defined   START_"   memmap
   }

   WHERE(START!="")
   {
"

      "START"
"
   }
"
      #undef  MEMMAP_ERROR
      #define MEMMAP_START_DONE
"
}

'
   #endif

#else   /* if MEMMAP_START_DONE is not defined */

`
.MEMMAP_PARENT AS memmap
{
"/* !Comment: " memmap " Stop Section treatment */
"
   WHERE(INDEX == 0)
   {
      "   #if defined   STOP_"   memmap  " && defined  START_"  memmap
   }
   WHERE(INDEX != 0)
   {
      "   #elif defined   STOP_"   memmap  " && defined  START_"  memmap
   }
   WHERE(STOP!="")
   {
"

      "STOP"
"
   }

"
      #undef START_"    memmap"
      #undef STOP_"     memmap"
      #undef MEMMAP_ERROR
      #undef MEMMAP_START_DONE
"
}

'
   #endif
#endif

#if defined MEMMAP_ERROR
   #error MEMMAP-E201 : Bad memory allocation into MemMap.h
#endif

`
}

/******************************************************************************/
/*          DEBUG  Mode Code Generation                                       */
/******************************************************************************/
.MEMMAP_CFG WHERE (OPTIMIZATION = DEBUG)
{
'
/******************************************************************************/
/*          MEMMAP selected mode:  DEBUG                                      */
/******************************************************************************/

`
.MEMMAP_MSN AS msn ORDERBY(INDEX)
{
   SECTION AS memmap
   {
       "#define  " msn "_START_"msn.PREFIX memmap "_ID  " .MEMMAP_CFG{SECTIONS_COUNTER_LIST MAX+1}"
"      "#define  " msn "_STOP_"msn.PREFIX memmap "_ID   " .MEMMAP_CFG{SECTIONS_COUNTER_LIST MAX+2}"
"
       {
           .MEMMAP_CFG{SECTIONS_COUNTER_LIST MAX+2 INTO SECTIONS_COUNTER_LIST}
       }
   }
}
.MEMMAP_PARENT AS parent ORDERBY(INDEX)
{
       "#define  START_" parent "_ID  " .MEMMAP_CFG{SECTIONS_COUNTER_LIST MAX+1}"
"      "#define  STOP_" parent "_ID   " .MEMMAP_CFG{SECTIONS_COUNTER_LIST MAX+2}"
"
       {
           .MEMMAP_CFG{SECTIONS_COUNTER_LIST MAX+2 INTO SECTIONS_COUNTER_LIST}
       }
}
'

#define MEMMAP_ERROR

/* The following if is used only due to automatic generation */
#if !defined MEMMAP_ERROR

/* Project section mappings */
`
.MEMMAP_MSN AS msn ORDERBY(INDEX)
{
"/* !Comment: " msn " Section allocation */
"
   SECTION AS memmap
   {
      msn.REALLOC AS realloc WHERE (realloc.SECTION == memmap)
      {
         "#elif defined   " msn "_STOP_" msn.PREFIX   memmap "
"        "   #if ((defined MEMMAP_LAST_USED_SECTION) &&  (MEMMAP_LAST_USED_SECTION == " msn "_START_" msn.PREFIX memmap "_ID))
"        "      #undef  " msn "_STOP_" msn.PREFIX memmap "
"        "      #undef  MEMMAP_START_DONE
"        WHERE(TO_SECTION.STOP!="")
         {
         "      "TO_SECTION.STOP"
"
         }
         "      #undef  MEMMAP_ERROR
"        "   #else
"        "      #error MEMMAP-E101 :  " msn "_STOP_" msn.PREFIX   memmap " end section is used before " msn "_START_" msn.PREFIX   memmap "
"        "   #endif
"        "   #undef MEMMAP_LAST_USED_SECTION
"        "   #define MEMMAP_LAST_USED_SECTION  " msn "_STOP_" msn.PREFIX   memmap "_ID
"        "#elif defined   " msn "_START_" msn.PREFIX   memmap"
"        "   #if FALSE

"
         .MEMMAP_MSN AS msn2 ORDERBY(INDEX)  CONCATE
         {
            SECTION AS memmap2 WHERE(!(( msn2 == msn) and (memmap == memmap2 ))) CONCATE
            {
               "   #elif ((defined MEMMAP_LAST_USED_SECTION) &&  (MEMMAP_LAST_USED_SECTION == " msn2 "_START_" msn2.PREFIX   memmap2"_ID))
"              "      #error MEMMAP-E102 : two section memory have been started: " msn "_START_" msn.PREFIX   memmap" and " msn2 "_START_" msn2.PREFIX   memmap2" (a STOP section is missing).
"
            }
         }
         .MEMMAP_PARENT AS parent ORDERBY(INDEX)
         {
               "   #elif ((defined MEMMAP_LAST_USED_SECTION) &&  (MEMMAP_LAST_USED_SECTION ==  START_" parent "_ID))
"              "      #error MEMMAP-E102 : two section memory have been started: " msn "_START_" msn.PREFIX   memmap" and START_" parent " (a STOP section is missing)."
         }
         "   #elif defined MEMMAP_START_DONE
"        "      #error MEMMAP-E103 : two same start section memory have been started : " msn "_START_" msn.PREFIX   memmap" and " msn "_START_" msn.PREFIX   memmap" (a STOP section is missing).
"        "   #else
"        WHERE(TO_SECTION.START!="")
         {
         "      "TO_SECTION.START"
"
         }
         "      #undef  MEMMAP_ERROR
"        "      #define MEMMAP_START_DONE
"        "      #undef  " msn "_START_" msn.PREFIX memmap "
"        "   #endif
"        "   #undef MEMMAP_LAST_USED_SECTION
"        "   #define MEMMAP_LAST_USED_SECTION  " msn "_START_" msn.PREFIX   memmap"_ID
"
      }
      WHERE (msn.REALLOC AS realloc WHERE (realloc.SECTION == memmap) COUNT == 0)
      {
         "#elif defined   " msn "_STOP_" msn.PREFIX   memmap "
"        "   #if ((defined MEMMAP_LAST_USED_SECTION) &&  (MEMMAP_LAST_USED_SECTION ==  " msn "_START_" msn.PREFIX memmap "_ID))
"        "      #undef  " msn "_STOP_" msn.PREFIX memmap "
"        "      #undef  MEMMAP_START_DONE
"        WHERE(memmap.STOP!="")
         {
         "      "memmap.STOP"
"
         }
         "      #undef  MEMMAP_ERROR
"        "   #else
"        "      #error MEMMAP-E101 :  " msn "_STOP_" msn.PREFIX   memmap " end section is used before " msn "_START_" msn.PREFIX   memmap "
"        "   #endif
"        "   #undef MEMMAP_LAST_USED_SECTION
"        "   #define MEMMAP_LAST_USED_SECTION  " msn "_STOP_" msn.PREFIX   memmap "_ID
"        "#elif defined   " msn "_START_" msn.PREFIX   memmap"
"        "   #if FALSE

"
         .MEMMAP_MSN AS msn2 ORDERBY(INDEX)  CONCATE
         {
            SECTION AS memmap2 WHERE(!(( msn2 == msn) and (memmap == memmap2 ))) CONCATE
            {
               "   #elif ((defined MEMMAP_LAST_USED_SECTION) &&  (MEMMAP_LAST_USED_SECTION ==   " msn2 "_START_" msn2.PREFIX   memmap2"_ID))
"              "      #error MEMMAP-E102 : two section memory have been started: " msn "_START_" msn.PREFIX   memmap" and " msn2 "_START_" msn2.PREFIX   memmap2" (a STOP section is missing).
"
            }
         }
         .MEMMAP_PARENT AS parent ORDERBY(INDEX)
         {
               "   #elif ((defined MEMMAP_LAST_USED_SECTION) &&  (MEMMAP_LAST_USED_SECTION ==  START_" parent "_ID))
"              "      #error MEMMAP-E102 : two section memory have been started: " msn "_START_" msn.PREFIX   memmap" and START_" parent " (a STOP section is missing)."
         }
         "   #elif defined MEMMAP_START_DONE
"        "      #error MEMMAP-E103 : two same start section memory have been started : " msn "_START_" msn.PREFIX   memmap" and " msn "_START_" msn.PREFIX   memmap" (a STOP section is missing).
"        "   #else
"        WHERE(memmap.START!="")
         {
         "      "memmap.START"
"
         }
         "      #undef  MEMMAP_ERROR
"        "      #define MEMMAP_START_DONE
"        "      #undef  " msn "_START_" msn.PREFIX memmap "
"        "   #endif
"        "   #undef MEMMAP_LAST_USED_SECTION
"        "   #define MEMMAP_LAST_USED_SECTION  " msn "_START_" msn.PREFIX   memmap"_ID
"
      }
   }
}


.MEMMAP_PARENT AS parent ORDERBY(INDEX)
{
         "#elif defined   STOP_" parent "
"        "   #if ((defined MEMMAP_LAST_USED_SECTION) &&  (MEMMAP_LAST_USED_SECTION ==  START_" parent "_ID))
"        "      #undef  STOP_" parent "
"        "      #undef  MEMMAP_START_DONE
"        WHERE(STOP!="")
         {
         "      "STOP"
"
         }
         "      #undef  MEMMAP_ERROR
"        "   #else
"        "      #error MEMMAP-E101 :  STOP_" parent " end section is used before START_"  parent "
"        "   #endif
"        "   #undef MEMMAP_LAST_USED_SECTION
"        "   #define MEMMAP_LAST_USED_SECTION  STOP_" parent "_ID
"        "#elif defined   START_"  parent "
"        "   #if FALSE

"
         .MEMMAP_MSN AS msn ORDERBY(INDEX)  CONCATE
         {
            SECTION AS memmap  CONCATE
            {
               "   #elif ((defined MEMMAP_LAST_USED_SECTION) &&  (MEMMAP_LAST_USED_SECTION == " msn "_START_" msn.PREFIX   memmap"_ID))
"              "      #error MEMMAP-E102 : two section memory have been started: START_"  parent " and " msn "_START_" msn.PREFIX   memmap" (a STOP section is missing).
"
            }
         }
         .MEMMAP_PARENT AS parent2 WHERE(parent != parent2 ) ORDERBY(INDEX)
         {
               "   #elif ((defined MEMMAP_LAST_USED_SECTION) &&  (MEMMAP_LAST_USED_SECTION == START_" parent2 "_ID))
"              "      #error MEMMAP-E102 : two section memory have been started: START_" parent " and START_" parent2 " (a STOP section is missing)."
         }
         "   #elif defined MEMMAP_START_DONE
"        "      #error MEMMAP-E103 : two same start section memory have been started : START_" parent " and START_" parent " (a STOP section is missing).
"        "   #else
"        WHERE(START!="")
         {
         "      "START"
"
         }
         "      #undef  MEMMAP_ERROR
"        "      #define MEMMAP_START_DONE
"        "      #undef  START_" parent "
"        "   #endif
"        "   #undef MEMMAP_LAST_USED_SECTION
"        "   #define MEMMAP_LAST_USED_SECTION  START_"  parent "_ID
"
}
'
#endif


#if defined MEMMAP_ERROR
   #if !defined MEMMAP_LAST_USED_SECTION
      #error MEMMAP-E104 : unknow memory section
`
.MEMMAP_MSN AS msn ORDERBY(INDEX)  CONCATE
{
   SECTION AS memmap  CONCATE
   {
      "   #elif  (MEMMAP_LAST_USED_SECTION == " msn "_START_" msn.PREFIX   memmap "_ID)
"     "      #error MEMMAP-E105 : unknow memory section after the  " msn "_START_" msn.PREFIX   memmap" one
"     "   #elif  (MEMMAP_LAST_USED_SECTION == " msn "_STOP_" msn.PREFIX   memmap "_ID)
"     "      #error MEMMAP-E105 : unknow memory section after the  " msn "_STOP_" msn.PREFIX   memmap" one
"
   }
}
.MEMMAP_PARENT AS parent ORDERBY(INDEX)
{
      "   #elif  (MEMMAP_LAST_USED_SECTION == START_"  parent "_ID)
"     "      #error MEMMAP-E105 : unknow memory section after the  START_"  parent " one
"     "   #elif  (MEMMAP_LAST_USED_SECTION == STOP_"  parent "_ID)
"     "      #error MEMMAP-E105 : unknow memory section after the  STOP_"  parent " one
"
}
'
   #else
      #error MEMMAP-E104 : unknow memory section
   #endif  /* #if !defined MEMMAP_LAST_USED_SECTION */
#endif   /* #if defined MEMMAP_ERROR */

`

.MEMMAP_MSN AS msn4 ORDERBY(INDEX)
{
   SECTION AS memmap
   {
"	    
#ifdef " msn4 "_START_"msn4.PREFIX memmap "_ID
#undef  " msn4 "_START_"msn4.PREFIX memmap "_ID 
#endif	

#ifdef " msn4 "_STOP_"msn4.PREFIX memmap "_ID
#undef  " msn4 "_STOP_"msn4.PREFIX memmap "_ID  
#endif
" 
   }
}
.MEMMAP_PARENT AS parent ORDERBY(INDEX)
{
"  
#ifdef  START_" parent "_ID
#undef  START_" parent "_ID 
#endif
		
#ifdef  STOP_" parent "_ID
#undef  STOP_" parent "_ID 
#endif
"
}


}

'  

/*------------------------------- end of file --------------------------------*/
`
/*------------------------------- end of file --------------------------------*/
